# import logging
#
# import allure
# import pytest
# from allure_commons.types import AttachmentType
# @pytest.hookimpl(tryfirst=True,hookwrapper=True)
# def test_run(itme,call):
#     a1=yield
#     report=a1.get_result()
#     if report.when == 'call':
#         logger = logging.getLogger("")
#         log_capture=[]
#         for time in logger.handlers:
#             if isinstance(time,logging.StreamHandler):
#                 log_capture.append(time.stream.getvalue())
#         if log_capture:
#             allure.attach('\n'.join(log_capture),'测试日志',AttachmentType.TEXT)